<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>对象案例</title>
    <script !src="">
      'use strict';
      let p = {
        name: 'tom',
        age: 121,
        son: { name: 'tom', age: 122, son: { name: 'tom', age: 122 } },
      };

      class A {}

      const a = new A();
      //通过A创建一个对象a，所以a的__proto__是指向A.prototype的
      console.log(A.prototype.isPrototypeOf(a));
      //A.__proto__是指向Object.prototype的
      console.log(Object.prototype.isPrototypeOf(A));
      //由于A.prototype的__proto__是指向Object.prototype的，所以a也就含有Object.prototype咯
      console.log(Object.prototype.isPrototypeOf(a));

      console.log(Object.prototype.isPrototypeOf(p));
      console.log(Object.getPrototypeOf(p));
      console.log(Object.getPrototypeOf(A));
      console.log(Object.getPrototypeOf(a));

      //
    </script>
  </head>
  <body></body>
</html>
